﻿using IBLL;
using System;
using System.Collections.Generic;
using System.Data.SqlClient;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace BLL
{
    public class FrQuestionBankManage_BLL : IFrQuestionBankManage_IBLL
    {
        SqlDataReader IFrQuestionBankManage_IBLL.Query()
        {
            StringBuilder sql = new StringBuilder();
            sql.Append("select * from SingleChoice where status=0;");
            sql.Append("select * from MultipleChoice where status=0;");
            sql.Append("select * from TrueOrFalseQuestions where status=0;");
            sql.Append("select * from Completion where status=0;");
            return DAL.SQLHepler.GetDataReader(sql.ToString());
        }

        SqlDataReader IFrQuestionBankManage_IBLL.Query(string path)
        {
            return DAL.SQLHepler.GetDataReader(path);
        }

        int IFrQuestionBankManage_IBLL.Query_ID(string s)
        {
            return Convert.ToInt32( DAL.SQLHepler.GetScalar(s));
        }
        int IFrQuestionBankManage_IBLL.SubMit(string s)
        {
            return Convert.ToInt32(DAL.SQLHepler.Update(s));
        }
    }
}
